import cookie from "./cookie";

const tokenName = "jia_yue_xing_token";

const setToken = (token: string) => {
  cookie.set(tokenName, token, { expires: 7 });
};

const getToken = () => {
  return cookie.get(tokenName);
};

const removeToken = () => {
  cookie.remove(tokenName);
};

const adminName = "admin";

const setAdmin = (admin: string) => {
  cookie.set(adminName, admin, { expires: 7 });
};

const getAdmin = () => {
  return cookie.get(adminName);
};

const removeAdmin = () => {
  cookie.remove(adminName);
};

export { setToken, getToken, removeToken, setAdmin, getAdmin, removeAdmin };
